<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script src="js/jquery.js"></script>
<script>
$(document).ready(function()
		{
	
	 $("#add_to_textarea").click(function(){
		 $("#individual_students").append($('input:text[name=selected_student]').val()+";");
		 
		 
		 
	 });   	 
	    	
	$("#s1").click(function(){
		
		var path=$("#f1").val().split("\\");
		$("#file_name").val(path[path.length-1]);
		
		
	});
	
		}
		
		
		
		);


</script>
</head>
<body>
<form action="sendmessage_degree_batch.action" method="post" enctype="multipart/form-data">
<input type="hidden" id="file_name" name="file_name"/>
<table  align="center">
<tr>
<td>Receipent Batches:</td>
<td><s:iterator value="batches_list"><input type="checkbox" name="batch_id" value="<s:property value="batch_id"/>"><s:property value="batch_name"/></input></s:iterator></td>
</tr>
<tr>
<td>Individual Students: </td><td><input type="text" name="selected_student" list="selected_student"/><input type="button" value="Add to List" id="add_to_textarea"/>
<datalist id="selected_student">
<s:iterator value="student_list">
<option value="<s:property value="email_id"/>"><s:property value="student_name"/></option>
</s:iterator>
</datalist>



</td>

</tr>
<tr>
<td>Selected Students:</td><td><textarea rows="3" cols="40" name="individual_students_emails" id="individual_students"></textarea></td>
</tr>
<tr>
<td>Subject:</td><td style=""><input type="text" required="true" name="subject" size="100"/>
</td>
</tr>
<tr>
<td>
Body:</td>
<td><textarea rows="20" cols="40" name="body" required="true">
At W3Schools you will find all the Web-building tutorials you need,
from basic HTML to advanced XML, SQL, ASP, and PHP. 
</textarea></td>

</tr>
<tr>
<td>
Attach a File:
</td>
<td><input type="file" id="f1" name="attached_file"/></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" id="s1" value="Send the Mail"/>
</td>
</tr>
</table>




</form>
</body>
</html>